import React, {useContext, useEffect} from "react";
import {Routes, Route, useLocation, useNavigate} from 'react-router-dom';
import Account from "../pages/Account";
import DeviceInfo from "../pages/Device/DeviceInfo";
import Dashboard from "../pages/Dashboard";
import DeviceAdd from "../pages/Device/DeviceAdd";
import Fault from "../pages/Fault";
import DeviceEdit from "../pages/Device/DeviceEdit";
import FaultAdd from "../pages/Fault/FaultAdd";
import FaultInfo from "../pages/Fault/FaultInfo";
import FaultEdit from "../pages/Fault/FaultEdit";

const MGTRouter = () => {
    return (
        <Routes>
            <Route path="/" element={<Dashboard/>}/>
            <Route path="/fault" element={<Fault/>}/>
            <Route path="/account" element={<Account/>}/>

            <Route path="/faultInfo/:typeId/:deviceId" element={<FaultInfo/>}/>
            <Route path={"/fault/edit/:typeId/:deviceId"} element={<FaultEdit/>}/>
            <Route path={"/fault/add"} element={<FaultAdd/>}/>

            <Route path="/deviceInfo/:typeId/:deviceId" element={<DeviceInfo/>}/>
            <Route path={"/device/edit/:typeId/:deviceId"} element={<DeviceEdit/>}/>
            <Route path={"/device/add/:typeId"} element={<DeviceAdd/>}/>
        </Routes>
    )
}

export default MGTRouter;
